/*
 * @Descripttion: 
 * @version: 
 * @Author: ada.wu
 * @Date: 2024-01-05 10:17:42
 * @LastEditors: ada.wu
 * @LastEditTime: 2024-03-08 10:04:39
 */
/**
 * 微信登录
 * @param appId
 * @param redirectUrl
 * @param state
 */
import { SystemsState } from "/@/store/interface";

export function wxLogin(conf: SystemsState, redirectUrl: string, state?: string) {

    let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${conf.wxMpAppId}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_userinfo&state=${state}`
    url += '#wechat_redirect'
    // window.location.href = url
    // window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appId + "&redirect_uri=" + encodeURIComponent(redirectUrl) + "&response_type=code&scope=snsapi_userinfo&state=" + state + "#wechat_redirect";
}
